package com.dn.designpatterns.singleton;

/**
 * @program: designpatterns
 * @description: 登记式/静态内部类  推荐使用
 * @author: DN
 * @create: 2021-03-28 16:51
 **/
public class SingletonFinal {
    private static class SingletonHolder {
        private static final SingletonFinal INSTANCE = new SingletonFinal();
    }
    private SingletonFinal() {}
    public static final SingletonFinal getInstance() {
        return SingletonHolder.INSTANCE;
    }
}
